#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n,k;
	scanf("%d%d", &n, &k);
	int a[100] = { 0 };
	for (int i = 1; i <= k; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			if (j % i == 0)
			{
				/*a[j] = !a[j];*/
				if(a[j]==0) a[j]=1;
				else a[j]=0;
			}
		}
	}
	int first = 1;
	for (int i = 1; i <= n; i++)
	{
		if (a[i])
		{
			if (first)
			{
				printf("%d", i);
				first = 0;
			}
			else
			{
				printf(" %d", i);
			}
		}
	}

}